package cn.lg.soar.boot.fc.entity;

import cn.lg.soar.core.annotations.constraints.group.*;
import cn.lg.soar.database.base.entity.BaseEntity;
import cn.lg.soar.database.query.annotations.*;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.*;
import io.swagger.annotations.*;
import lombok.Data;
import java.io.Serializable;
import java.time.*;
import javax.validation.constraints.*;


/**
 * 合租房间表
 * @author ZhuanZ（无密码）
 * @since 2025-01-18
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Data
@ApiModel(value = "Lease", description = "合租房间表")
@TableName("fc_lease")
public class Lease extends BaseEntity {

    /** 合租ID */
    @NotNull(message = "主键不能为空", groups = { Update.class })
    @ExcelIgnore
    @ApiModelProperty(value = "主键")
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 校区ID */
    @NotNull(message = "校区ID不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "校区ID")
    @ApiModelProperty(value = "校区ID")
    private Long campusId;

    /** 楼栋ID */
    @NotNull(message = "楼栋ID不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "楼栋ID")
    @ApiModelProperty(value = "楼栋ID")
    private Long buildingId;

    /** 单元ID */
    @NotNull(message = "单元ID不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "单元ID")
    @ApiModelProperty(value = "单元ID")
    private Long unitId;

    /** 楼层ID */
    @NotNull(message = "楼层ID不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "楼层ID")
    @ApiModelProperty(value = "楼层ID")
    private Long floorId;

    /** 房间ID */
    @NotNull(message = "房间ID不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "房间ID")
    @ApiModelProperty(value = "房间ID")
    private Long roomId;

    /** 单室房间名称 */
    @NotBlank(message = "单室房间名称不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "单室房间名称")
    @ApiModelProperty(value = "单室房间名称")
    private String name;

    /** 单室房间图片 */
    @ExcelProperty(value = "单室房间图片")
    @ApiModelProperty(value = "单室房间图片")
    private String img;

    /** 单室房间面积 */
    @NotBlank(message = "单室房间面积不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "单室房间面积")
    @ApiModelProperty(value = "单室房间面积")
    private String area;

    /** 月租金 */
    @NotBlank(message = "月租金不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "月租金")
    @ApiModelProperty(value = "月租金")
    private String rent;

    /** 朝向 */
    @NotBlank(message = "朝向不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "朝向")
    @ApiModelProperty(value = "朝向")
    private String orient;

    /** 使用状态(0-空置 1-待签约 2-已租 3-维修中 4-不能居住) */
//    @NotNull(message = "使用状态(0-空置 1-待签约 2-已租 3-维修中 4-不能居住)不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "使用状态(0-空置 1-待签约 2-已租 3-维修中 4-不能居住)")
    @ApiModelProperty(value = "使用状态(0-空置 1-待签约 2-已租 3-维修中 4-不能居住)")
    private Integer useState;

    /** 乐观锁 */
    @ExcelProperty(value = "乐观锁")
    @ApiModelProperty(value = "乐观锁")
    private Integer version;

    @JsonIgnore
    @Override
    public Long primaryKey() {
        return this.id;
    }

}
